﻿using CommonUtility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;

namespace WebApplication.Business
{
    public partial class MyMessage : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string action = Common.ToString(Request["Action"]);
            switch (action)
            {
                case "GetList":
                    Response.Write(LoadList());
                    Response.End();
                    break;
                case "Process":
                    Response.Write(Process());
                    Response.End();
                    break;
                case "SetRead":
                    Response.Write(SetRead());
                    Response.End();
                    break;
            }
        }

        /// <summary>
        /// 获取明细
        /// </summary>
        /// <returns></returns>
        private string LoadList()
        {
            string _read = Common.ConvertSql(Common.ToString(Request["Status"]));
            return bllMessage.GetList(_read, oUser);
        }


        /// <summary>
        /// 设置read
        /// </summary>
        /// <returns></returns>
        private string Process()
        {
            string _rids = Common.ConvertSql(Common.ToString(Request["Rids"]));
            return bllMessage.Process(_rids, oUser);
        }

        /// <summary>
        /// 按FlowNode设置Read
        /// </summary>
        /// <returns></returns>
        private string SetRead()
        {
            string _FlowNode = Common.ToString(Request["FlowNode"]);
            bllMessage.SetRead(_FlowNode, oUser);
            return "";
        }
    }
}